package Utils;

import lejos.nxt.LightSensor;

public class LightSensorMethod {

	public static final int EMPTY_CELL = 0;
	

	
	public static final int FIRST_ROOM_PEASENT = 1;
	public static final int SECOND_ROOM_PEASENT = 2;
	
	public static final int KING = 3;
	
	public static final int PRINCESS = 4;
	public static final int DRAGON = 5;
	
	public static int readCellLevel1 ( LightSensor mLightSensor ) {
	
		int sensorReading = mLightSensor.readNormalizedValue();
		
		if(sensorReading < 315) {
			return FIRST_ROOM_PEASENT;
		} else if (sensorReading < 350 ) {
			return KING;
		} else if (sensorReading < 400 ) {
			return SECOND_ROOM_PEASENT;
		} else {
			return EMPTY_CELL;
		}
		
	}
	
	
	public static int readCellLevel2 ( LightSensor  mLightSensor ) {
		
		int sensorReading = mLightSensor.readNormalizedValue();
		
		if(sensorReading < 315) {
			return PRINCESS;
		} else if (sensorReading < 400 ) {
			return DRAGON;
		} else {
			return EMPTY_CELL;
		}
	}
	
}
